namespace Launcher.Ui

import System
import System.Drawing

class Factory:
"""Description of Factory"""
	private def constructor():
		pass
		
	static def CreateBackButton():
		return CircularButton(Painter: DrawBack)
		
	static def CreateNextButton():
		return CircularButton(Painter: DrawNext)

	static def CreateCloseButton():
		return CircularButton(Painter: DrawClose)

def DrawBack(g as Graphics, canvas as CircularButton):
	d = 20
	y =  canvas.Location.Y + 8
	points = (Point(canvas.Location.X + d, y + 32),
				Point(canvas.Location.X + 64 - d, y + d), 
				Point(canvas.Location.X + 64 - d, y + 64 - d))
				
	g.FillPolygon(GetBrush(canvas.Selected), points)
		
def DrawNext(g as Graphics, canvas as CircularButton):
	d = 20
	y = canvas.Location.Y + 8
	points = (Point(canvas.Location.X + 64 - d, y + 32),
				Point(canvas.Location.X + d, y + d), 
				Point(canvas.Location.X + d, y + 64 - d))
				
	g.FillPolygon(GetBrush(canvas.Selected), points)
	
def DrawClose(g as Graphics, canvas as CircularButton):
	d = 14
	s = 5
	y = canvas.Location.Y + 8
	mx = canvas.Location.X + 32
	my = y + 32
	points = (
				Point(mx + s, my),
				Point(mx + d, my + d),
				Point(mx, my + s),
				Point(mx - d, my + d),
				Point(mx - s, my),
				Point(mx - d, my - d),
				Point(mx, my - s),
				Point(mx + d, my - d))
				
	g.FillPolygon(GetBrush(canvas.Selected), points)

def GetBrush(selected as bool):
	color = (Color.FromArgb(255, 128, 128, 255) 
			if selected 
			else Color.FromArgb(255, 192, 192, 192))
			
	return SolidBrush(color)
